from framework.capture__ import *
from data_type import *
from datetime import *

#packet_stream = {}
    
flow = []
    
Ethernet = EthernetPkt()
Ipv4 = Ipv4Pkt()
Ipv6 = Ipv6Pkt()
Tcp = TcpPkt()
Udp = UdpPkt()
Arp = ArpPkt()
Dns = DnsPkt()
Icmpv4 = Icmpv4Pkt()
Icmpv6 = Icmpv6Pkt()
HttpReq = HttpReqPkt()
HttpRes = HttpResPkt()
    
eachPkt = Packet(Ethernet, Ipv4, Ipv6, Tcp, Udp, Arp, Dns, Icmpv4, Icmpv6, HttpReq, HttpRes)
        
with open("C://Users//leslie//Desktop//res//cur//demo.pkl",'rb') as f:
    while 1:
        try:
            eachPkt = pickle.load(f)
            flow.append(eachPkt)
            print(eachPkt)
            eachPkt.PrintFlag()
        except EOFError:
            break

    
print(len(flow))